1. Field of the Invention
The present invention relates to implementation of text-based applications programming interfaces that provide data compression for communication of protocols between two devices via a bandwidth-limited channel.
2. Description of the Related Art
Networking communications is based on establishment of a communications protocol between two devices for transfer of information via a communications channel. The communications protocol established between the two devices enables these two devices to optimize communication based on the characteristics of the communications channel, where a receiver can recover data transmitted by the transmitter. As illustrated by the Open Systems Interconnect (OSI) reference model, devices typically are implemented utilizing several xe2x80x9clayersxe2x80x9d (i.e., xe2x80x9clevelsxe2x80x9d) of communications protocols, where each communication protocol layer is configured for executing a corresponding communication protocol based on a corresponding prescribed set of commands. Such layering of prescribed communications protocols has enabled communications of different application processes across a common transmission medium. The commands for a given communication protocol may be collectively referred to as an applications programming interface (APIs).
Different types of APIs have been defined for different communications protocols. One type of API is a binary API, which has the advantage of providing a precise and compressed interface.
FIG. 1A is a diagram illustrating a conventional binary protocol, where a xe2x80x9cpacketxe2x80x9d 10 generated according to a specified protocol interface includes a first 1-bit field 12a, followed by a second 3-bit field 12b, followed by a third 4-bit field 12c. The binary protocol used to generate the packet 10 provides a precise interface in that the location of each information element 12 is well defined. The binary protocol used to generate the packet 10 also provides a relatively high compression level, enabling three information elements 12a, 12b, and 12c to share a single data byte 14. An example of a binary protocol is the Ethernet (IEEE 802.3) protocol.
Binary interfaces suffer from the disadvantage of a lack of flexibility and a lack of readability by a programmer. In particular, the information element 12a composed of a single bit allows only two states; hence, a desire to add a third state to the information element 12a would require either a complete redefinition of the byte 14, or addition of a second byte 16 to accommodate the added state.
Another popular format for APIs are ASCII (text) based interfaces, illustrated in FIG. 1B. Exemplary text-based interfaces include POP3, SMTP, HTTP, HTML, XML, and SIP. As illustrated in FIG. 1B, a text-based document 20 includes a tag 22 specifying prescribed attributes 24 having specified values 26. The structure of the document 20 enables data to be arranged in any order, and enables different operations to be specified based on adding tags. The tags may be have predetermined attributes such as found with HTML, or the tags may have extensible attributes defined by referenced document type descriptors (DTDs) as found in XML.
Hence, text-based APIs provide flexibility and extensibility for future applications. However, text-based APIs require a substantially larger data size (i.e., a larger number of bytes) to store the same information as otherwise required for a binary API; in particular, several bytes are required for transfer of the text information, often resulting in a size expansion of 20 to 1 compared to binary APIs. The larger data byte requirements for text-based APIs significantly limit the ability to use text-based APIs via bandwidth-limited channels, for example wireless data channels.
One approach to reduce the data size of information involves link layer compression, for example V.42 is compression as utilized in modems and wireless devices. The V.42 compression is a general purpose compression algorithm that is applied xe2x80x9ctransparentlyxe2x80x9d (i.e., independent of higher layer protocol operations) to all data traffic that flows across the communication channel. The V.42 compression algorithm dynamically builds a xe2x80x9ccode bookxe2x80x9d of symbols that are relevant to all the protocols (i.e., APIs) that it transports during a communication session. In particular, the V.42 compression algorithm builds the code book as the data stream is compressed; hence, the V.42 compression algorithm must communicate the code book in its entirety to its peer on the communication link to enable the data stream to be decompressed. Consequently, the necessity of sending a new code book for each communication session results in a loss of available bandwidth for the protocol information.
Another problem associated with implementation of APIs in a device involves the memory consumption for storage of the respective sets of executable source code. In particular, an API typically is implemented by loading a unique set of executable source code for the API into the device. For example, if a device supports an HTTP service, a Telnet service, an FTP service and a Voice Gateway service, where each service utilizes a different corresponding protocol and a corresponding communications port, then each service would be implemented by loading and executing a corresponding unique set of executable source code for the corresponding protocol. Hence, implementation of multiple APIs requires memory space for each of the respective sets of executable source code.
There is a need for an arrangement that enables a transmitting network device, for example a mobile wireless telephone or a base station, to establish a protocol interface with a peer network device via a communications channel, where the protocol interface is implemented using text-based applications programming interfaces and having effective compression that minimizes bandwidth utilization of the communications channel.
There also is a need for an arrangement that enables a transmitting network node to transmit, via a communications channel, compressed data for a text-based protocol and generated based on compression codes from a code book, where the transmitting network node transmits descriptors enabling a receiving network node to reconstruct the code book.
There also is a need for an arrangement that enables a transmitting network node to support multiple protocols by utilizing respective APIs implemented based on shared attributes, enabling memory requirements for execution of the APIs to be reduced.
These and other needs are attained by the present invention, where a synthetic code book is used to identify compression codes applied to API commands for generation of synthesized data. The synthetic code book is specified by code-book tags having semantics defined according to a generic code book document type definition (DTD). The API commands are based on semantics defined by a generic API DTD. The synthesized data and the code-book tags are supplied to a destination device configured for storing the generic code book DTD and the generic API DTD, enabling the destination device to synthesize a code book for recovery of the API commands from the synthesized data.
Hence, the destination device can recover the API commands from the synthesized data based on the synthesized code book, eliminating the necessity of supplying an entire code book during each communication session.
In addition, memory requirements for execution of the APIs can be reduced, based on the generic API DTD. In particular, the inventors have realized that communications protocols (e.g., HTTP, Telnet, FTP, Voice Gateway) have similar xe2x80x9cmacroscopicxe2x80x9d (i.e., logical) properties, including a set of commands which must be selected from, a set of procedures to execute for each command, a specific set of states the protocol may encounter, etc. Hence, these similar macroscopic properties, which are shared among the different protocols, can be realized by the generic API DTDs, which serve as a xe2x80x9cgeneric code setxe2x80x9d that can be shared across all the APIs stored in a device. In other words, the generic API DTDs serve as a xe2x80x9cmeta-APIxe2x80x9d language that can be used to define APIs. Hence, the semantics of each API can be realized by the generic API DTDs, minimizing the code space required to implement the APIs.
One aspect of the present invention provides a method in a source device of supplying an application programming interface (API) command to a destination device via a communications channel. The method includes specifying the API command using first tags having semantics defined based on a generic API document type definition (DTD), and compressing the first tags using selected compression codes to generate compressed data. The method also includes synthesizing a synthetic DTD, identifying the selected compression codes, by specifying second tags having semantics defined by a generic code book DTD, and transmitting the compressed data and the second tags via the communications channel. Hence, the compressed data and the second tags enable the destination device to synthesize the synthetic DTD based on the second tags and a stored copy of the generic code book DTD, for synthesis of the API command by decompressing the first tags and based on a stored copy of the generic API DTD.
Another aspect of the present invention provides a method in a destination device of receiving an application programming interface (API) command from a source device via a communications channel. The method includes storing a generic API document type definition (DTD) and a generic code book DTD, and receiving, from the source device, compressed data and first tags having semantics defined based on the generic code book DTD. The method also includes first synthesizing a synthetic DTD based on the first tags and the generic code book DTD, and second synthesizing second tags based on decompressing the compressed data according to the synthetic DTD, the second tags having semantics defined based on the generic API DTD. The API command is executed based on interpreting the second tags based on the generic API DTD.
Hence, API commands used for communication of a text-based protocol can be transferred to a destination device based on synthesizing a synthetic DTD using received first tags having semantics defined based on a generic code book DTD stored in the destination device. Hence, API commands can be transferred to a destination device, providing protocol flexibility without compromising the communications channel bandwidth.
Additional advantages and novel features of the invention will be set forth in part in the description which follows and in part will become apparent to those skilled in the art upon examination of the following or may be learned by practice of the invention. The advantages of the present invention may be realized and attained by means of instrumentalities and combinations particularly pointed out in the appended claims.